package com.example.myvertx.handler;

import com.example.myvertx.model.Pet;
import io.vertx.core.Future;
import io.vertx.ext.web.RoutingContext;

import java.util.function.Function;

public class GetPetHandler implements Function<RoutingContext, Future<Pet>> {
  /**
   * Applies this function to the given argument.
   *
   * @param routingContext the function argument
   * @return the function result
   */
  @Override
  public Future<Pet> apply(RoutingContext routingContext) {
    return Future.succeededFuture(new Pet().id(1L).name("Fluffy"));
  }
}
